waxClass{"NormalReattack",HNAbstractLogic}
function init(self)
self.super:init()
  self.reattack = 1
  self.unreattack = 0
return self
end

function act (self,b,a,center)
    print ('--reattack--')
    if self.unreattack == 1 then
     self.unreattack = 0
     return
    end

    if self.reattack ~= 1 then
       return
    end
    self.reattack = self.reattack - 1 

    center:addObject_forKey(a,'attack')

local damage = a.maxdamage
b.tllhp = (b:count()-1)*(b.maxhp) + b.hp
b.tllhp = b.tllhp - damage * a.attack / b.defense 

b:setCount(b.tllhp/b.maxhp)
b.hp = b.tllhp%b.maxhp

    if b.hp >= 0 then
        center:addObject_forKey(b,'beattacked')
    else
        center:addObject_forKey(b,'die')
    end
    return self.reattack
end


function reset(self)
   self.reattack = 1
end

function deact(self)
   self.unreattack = 1
end